<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="h" uri="/WEB-INF/config/tag/feonix-tags.tld"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="shortcut icon" href="/favicon.ico" />
<title>${appName }</title>
<h:head validity="true" message="true" placeholder="true" cookie="true"></h:head>
<h:import type="css" path="/resources/complat/support/login/css/style.css"></h:import>
<h:import type="js" path="/resources/complat/support/login/js/Particleground.js"></h:import>
<style>
body{height:100%;background:#16a085;overflow:hidden;}
canvas{z-index:-1;position:absolute;}
</style>
<script>
	
	$(function() {
		//粒子背景特效
		$('body').particleground({
			dotColor : '#5cbdaa',
			lineColor : '#5cbdaa'
		});
	});
	window.alert = function(msg, type, fu) {
		$('input, button').blur();
		top.$.messager.alert('消息', msg, type, fu);
	};
	window.confirm = function(msg, okCall, cancelCall) {
		$('input, button').blur();
		top.$.messager.confirm('消息', msg, function(flag) {
			if (flag) {
				if (typeof (okCall) != 'undefined') {
					okCall();
				}
			} else {
				if (typeof (cancelCall) != 'undefined') {
					cancelCall();
				}
			}
		});
	};
	$.validity.setup({
		outputMode : "showErr"
	}); //校验错误弹出

	$(function() {
		var cookiePath = '${contextPath}/';
		$.removeCookie('channel', {
			path : cookiePath
		});
		$.removeCookie('pageUrl', {
			path : cookiePath
		});
		$.removeCookie('menuUrl', {
			path : cookiePath
		});
		/*
		 * 校验输入
		 */
		$('#loginform').validity(function() {
			$('#name').require('请填写用户名!');
			$('input[type=password]').require('请填写密码!');
			<c:if test="${isVerifyCode == true}">
			$('#randcode').require('请填写验证码!');
			</c:if>
		}, {
			beforeSubmit : function(validateResult) {
				
			},
			success : function(ajaxResult) {
				if (ajaxResult.success) {
					top.location.href = '../manager/main/index';
				} else {
					$('#verifyImg').click();
					alert(ajaxResult.message);
				}
				$('#login-btn').text('登 录');
			},
			error : function() {
				$('#verifyImg').click();
				$('#login-btn').text('登 录');
			}
		});
	});
</script>
</head>
<body>
	<form action="${url }" method="post" id="loginform">
		<dl class="admin_login">
		<dt>
			<strong>${appName}</strong> <em>${appName}</em>
		</dt>
		<dd class="user_icon">
			<input type="text" placeholder="账号" class="login_txtbx" id="name"
				name="name" />
		</dd>
		<dd class="pwd_icon">
			<input type="password" placeholder="密码" class="login_txtbx"
				name="password" />
		</dd>
		<dd class="val_icon">
			<input type="text" id="randcode" name="randcode"  placeholder="验证码"
					maxlength="4" class="login_txtbx1">
			<h:verifycode url="../verifyCode.do" randKey="rand" width="80" height="35" style="line-height:35;"></h:verifycode>
		</dd>
		<dd>
			<input type="submit" value="立即登陆" class="submit_btn" />
		</dd>
		<dd>
			<p>${copyRight}</p>
		</dd>
	</dl>
	</form>
	
</body>
</html>